package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)" json:"username"`
	Password string `gorm:"type:varchar(200)" json:"password"`
}

type Role struct {
	gorm.Model
	Name   string `gorm:"type:varchar(30)" json:"name"`
	Face   string `gorm:"type:varchar(30)" json:"face"`
	Sex    string `gorm:"type:varchar(30)" json:"sex"`
	UserID int    `gorm:"type:int" json:"user_id"`
	User   User   `gorm:"foreignKey:UserID" json:"user"`
}

type Power struct {
	gorm.Model
	Content string `gorm:"type:varchar(100)" json:"content"`
	RoleID  int    `gorm:"type:int" json:"role_id"`
	Role    User   `gorm:"foreignKey:RoleID" json:"role"`
}
